using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace way.model
{
    public class TableCacheKeyFactory : ModelCacheKeyFactory {
        private readonly string _targetTableName;
        public TableCacheKeyFactory(ModelCacheKeyFactoryDependencies dependencies):base(dependencies) {
            
        }
        public override object Create(DbContext context,bool designTime)
        {
            if (context is AppDbContext dynamicContext) {
                return Tuple.Create(typeof(AppContext), dynamicContext.tableName);
            }
            //return (context.GetType(), designTime);
            return base.Create(context, designTime);
        }
    }
}
